<template>
  <div id="app">
    <!-- 对于需要导航栏的页面，使用 NavigationLayout -->
    <NavigationLayout v-if="shouldShowNavigation">
      <router-view />
    </NavigationLayout>
    
    <!-- 对于登录/注册页面，直接显示 router-view -->
    <router-view v-else />
  </div>
</template>

<script setup>
import { computed } from 'vue'
import { useRoute } from 'vue-router'
import NavigationLayout from './components/NavigationLayout.vue'

const route = useRoute()

// 判断是否需要显示导航栏
// 登录、注册、人脸识别、Home页面不显示导航栏（因为Home有自己的导航栏）
const shouldShowNavigation = computed(() => {
  const noNavRoutes = [
    '/doctor/login',
    '/doctor/register',
    '/doctor/info-form',
    '/login',
    '/register',
    '/recognition',
    '/home'
  ]
  
  return !noNavRoutes.includes(route.path)
})
</script>

<style>
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

#app {
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

/* Element Plus 样式定制 */
.el-button {
  border-radius: 6px;
}

.el-card {
  border-radius: 12px;
}

.el-input__wrapper {
  border-radius: 6px;
}

.el-textarea__inner {
  border-radius: 6px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .el-main {
    padding: 20px 15px !important;
  }
  
  .el-card {
    margin: 0 10px;
  }
}
</style>
